home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / dev / lang / Python16_Src.lha / Python16_Source / Include / funcobject.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-08-03  |  1.2 KB  |  41 lines

  1. #ifndef Py_FUNCOBJECT_H
  2. #define Py_FUNCOBJECT_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6.  
  7. /* Function object interface */
  8.  
  9. typedef struct {
  10.     PyObject_HEAD
  11.     PyObject *func_code;
  12.     PyObject *func_globals;
  13.     PyObject *func_defaults;
  14.     PyObject *func_doc;
  15.     PyObject *func_name;
  16. } PyFunctionObject;
  17.  
  18. extern DL_IMPORT(PyTypeObject) PyFunction_Type;
  19.  
  20. #define PyFunction_Check(op) ((op)->ob_type == &PyFunction_Type)
  21.  
  22. extern DL_IMPORT(PyObject *) PyFunction_New Py_PROTO((PyObject *, PyObject *));
  23. extern DL_IMPORT(PyObject *) PyFunction_GetCode Py_PROTO((PyObject *));
  24. extern DL_IMPORT(PyObject *) PyFunction_GetGlobals Py_PROTO((PyObject *));
  25. extern DL_IMPORT(PyObject *) PyFunction_GetDefaults Py_PROTO((PyObject *));
  26. extern DL_IMPORT(int) PyFunction_SetDefaults Py_PROTO((PyObject *, PyObject *));
  27.  
  28. /* Macros for direct access to these values. Type checks are *not*
  29.    done, so use with care. */
  30. #define PyFunction_GET_CODE(func) \
  31.         (((PyFunctionObject *)func) -> func_code)
  32. #define PyFunction_GET_GLOBALS(func) \
  33.     (((PyFunctionObject *)func) -> func_globals)
  34. #define PyFunction_GET_DEFAULTS(func) \
  35.     (((PyFunctionObject *)func) -> func_defaults)
  36.  
  37. #ifdef __cplusplus
  38. }
  39. #endif
  40. #endif /* !Py_FUNCOBJECT_H */
  41.